package lambda;

import java.io.File;
import java.io.FileFilter;

public class Test {
    public static void main(String[] args) {
        /*FileFilter filter = new FileFilter() {
            @Override
            public boolean accept(File file) {
                return file.getName().contains("o");
            }
        };
        File dir = new File(".");
        File[] subs = dir.listFiles(filter);
        for (int i=0;i<subs.length;i++){
            System.out.println(subs[i].getName());
        }*/

        //FileFilter filter = file -> file.getName().contains("o");
        File dir = new File(".");
        File[] subs = dir.listFiles(file -> file.getName().contains("o"));
        for (int i=0;i<subs.length;i++){
            System.out.println(subs[i].getName());
        }


    }
}
